package collection;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class SortListDemo3 {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        list.add("苍老师");
        list.add("小泽老师");
        list.add("传奇");
        System.out.println(list);

        Collections.sort(list,((o1, o2) -> o1.length()-o2.length()));

        System.out.println(list);
    }
}
